// Copyright 2022 jeff.li. and/or its affiliates.

#pragma once

#include <cstddef>
#include <cstdint>

namespace tbir::runtime::regex {

    typedef struct {
        void *base;
        void *elts;
        size_t nelts;
        size_t size;
        size_t nalloc;
    } c_array_t;

    extern c_array_t *c_array_create(size_t n, size_t size);

    extern void c_array_destroy(c_array_t *a);

    extern void *c_array_push(c_array_t *a);

    extern void *c_array_push_n(c_array_t *a, size_t n);

    extern int c_array_init(c_array_t *array, size_t n, size_t size);

}  // namespace tbir::runtime::regex
